<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@ page import="org.apache.commons.lang.*" %>
<%

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
//产生随机数，和密码一起生成MD5
request.getSession().setAttribute("md5RandomKey",RandomStringUtils.randomAlphabetic(10));
%>
<!DOCTYPE HTML>
<html>
  <head>
  	
  	
    <base href="<%=basePath%>">
    
    <title>后台管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/main.css"/>
    <script type="text/javascript" src="UI/admins/js/libs/modernizr.min.js"></script>
	<script type="text/javascript" src="UI/js/libs/md5.js"></script>
	<script type="text/javascript" src="UI/admins/js/libs/jquery.js"></script>
	<script type="text/javascript">
	function encryptionPassword(){	
		var myName="<%=session.getAttribute("md5RandomKey")%>"; 
	     var hash = MD5(document.getElementById('pwd').value+"${md5RandomKey}");  
	     document.getElementById('pwd').value = hash;  
	    } 
	</script>
  </head>
  
  <body>
    <!--/sidebar-->
        <div class="crumb-wrap">

            <div class="crumb-list"><i class="icon-font"></i>首页<span class="crumb-step">&gt;</span><a class="crumb-name" href="listAllAdmin">管理员管理</a><span class="crumb-step">&gt;</span><span>新增管理员</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
            	<s:form action="addAdmin" method="post">
                    <table class="insert-tab" width="100%">
                        <tbody>
                            <tr>
                                <th width="120"><i class="require-red">*</i>账号：</th>
                                <td>
                                    <s:textfield name="account"  class="common-text required" ></s:textfield>
                                </td>
                            </tr>
							 <tr>
                                <th><i class="require-red">*</i>管理员名字：</th>
                                <td>
                                	<s:textfield name="name"  class="common-text required" ></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>管理员角色：</th>
                                <td>
                                	<s:textfield type="radio" name="role"  class="common-text required" value="1" checked="checked"></s:textfield>自助终端管理员
                                	<s:textfield type="radio" name="role"  class="common-text required" value="2"></s:textfield>媒体管理员
                                	<s:textfield type="radio" name="role"  class="common-text required" value="3"></s:textfield>订单管理员
                                	<s:textfield type="radio" name="role"  class="common-text required" value="4"></s:textfield>用户配送员管理员
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>密码：</th>
                                <td>
                                	<input id="pwd" name="pwd" class="common-text required">
                                </td>
                                	
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>确认密码：</th>
                                <td>
                                	<s:textfield name="pwd1"  class="common-text required" ></s:textfield>
                                </td>
                            </tr>
                            
                            <tr>
                                <th></th>
                                <td>

                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit" >
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </s:form>
            </div>
        </div>

    <!--/main-->

  </body>
</html>
